import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store(
  {
    state: {
      currentUser: {}, //全局用户信息
      webInfo: {},    //全局网站信息
      errorMessage: null,
    },
    mutations: {
      errorMessage(state, message) {
        state.errorMessage = message;
      },
      currentUser(state, user) {
        state.currentUser = user
      },
      webInfo(state, webifno) {
        state.webInfo = webifno
      }
    }
  }
)
export default store
